Skip to content

chore(repositories): When making a ProjectRepository link, upgrade the source if we have a stronger signal#116543

Merged
wedamija merged 4 commits into
masterfrom
danf/proj-repo-link-upgrade-source
Jun 1, 2026
Merged

chore(repositories): When making a ProjectRepository link, upgrade the source if we have a stronger signal#116543
wedamija merged 4 commits into
masterfrom
danf/proj-repo-link-upgrade-source

Conversation

@wedamija
Copy link
Copy Markdown
Member

We're adding auto detection of links in #116533 and potentially in other places. If we get a stronger signal that the link is correct later we should update the row.

@wedamija wedamija requested a review from a team May 29, 2026 23:31
@wedamija wedamija requested review from a team as code owners May 29, 2026 23:31
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 29, 2026
Comment thread src/sentry/models/projectrepository.py Outdated
Comment thread src/sentry/models/projectrepository.py Outdated
Copy link
Copy Markdown
Member

@srest2021 srest2021 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, couple minor optional nits

Comment thread tests/sentry/models/test_projectrepository.py
Comment thread src/sentry/models/projectrepository.py Outdated
self,
project_id: int,
repository_id: int,
source: int,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be typed ProjectRepositorySource

Comment thread src/sentry/models/projectrepository.py Outdated
and source != ProjectRepositorySource.AUTO_NAME_MATCH
):
project_repo.source = source
project_repo.save(update_fields=["source"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be nice to have an array like

# Indicates how 'strong of a signal' each source is. A lower number indicates
# less confdence that the linking is correct.
SOURCE_PRIORITY: dict[ProjectRepositorySource, int] = {
  MANUAL = 500
  SEE_PREFERENCE = 500
  AUTO_EVENT = 200
  AUTO_NAME_MATCH = 100
}

then we could compare current and new source to decide if we're upgrading.

wedamija and others added 3 commits June 1, 2026 13:11
…e source if we have a stronger signal

We're adding auto detection of links in #116533 and potentially in other places. If we get a stronger signal that the link is correct later we should update the row.
…notation

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
@wedamija wedamija force-pushed the danf/proj-repo-link-upgrade-source branch from 202ffbb to 35c8f46 Compare June 1, 2026 21:30
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 35c8f46. Configure here.

Comment thread src/sentry/models/projectrepository.py
@wedamija wedamija enabled auto-merge (squash) June 1, 2026 21:42
@wedamija wedamija merged commit fd966b4 into master Jun 1, 2026
70 checks passed
@wedamija wedamija deleted the danf/proj-repo-link-upgrade-source branch June 1, 2026 21:56
afsuyadi pushed a commit to afsuyadi/sentry that referenced this pull request Jun 2, 2026
…e source if we have a stronger signal (getsentry#116543)

We're adding auto detection of links in
getsentry#116533 and potentially in other
places. If we get a stronger signal that the link is correct later we
should update the row.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants